﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace GH.Web.UionReport
{
    public partial class DemocraticManagementPrint : BasePage.PageBase
    {
        public DataSet dsRecord = new DataSet();
        public static string UnitRoot = System.Configuration.ConfigurationSettings.AppSettings["UnitRoot"];
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                GH.BLL.DemocraticManagement bllDemocraticManagement = new GH.BLL.DemocraticManagement();


                lblCurrentYear.Text = System.DateTime.Now.Year.ToString();




                string strWhere = "  1=1";
                if (Request["RightsFlg"].ToString() == "Summary")
                {
                    strWhere += " AND  厂务公开民主管理统计表.年份='" + Session["SelectCurrentYear"].ToString() + "'";
                    dsRecord = bllDemocraticManagement.GetListSum(strWhere);
                    lblUnionName.Text =UnitRoot;
                }
                else if (Request["RightsFlg"].ToString() == "SELECT")
                {
                    strWhere += " AND  厂务公开民主管理统计表.单位=" + this.Session["UnionSelect"].ToString();
                    strWhere += " AND  厂务公开民主管理统计表.年份='" + Session["SelectCurrentYear"].ToString() + "'";
                    dsRecord = bllDemocraticManagement.GetList(strWhere);
                    GH.Model.工会单位信息 modUnion = new GH.BLL.Union().GetModel(int.Parse(this.Session["UnionSelect"].ToString()));
                    lblUnionName.Text = modUnion.单位名称;
                }
            }
        }
    }
}
